﻿using System;

namespace LTJ.Config
{
    /// <summary>
    /// 全局基本设置描述类, 加[Serializable]标记为可序列化
    /// </summary>
    [Serializable]
    public class GeneralConfigInfo : IConfigInfo
    {
        #region 私有字段
        private string m_sitetitle = "乐体检网"; //网站名称
        private string m_siteurl = "index.aspx"; //网站url地址
        private string m_webtitle = "SAS!NT"; //网站名称
        private string m_weburl = ""; //网站url地址
        private string m_usermanagerurl = "";   //用户后台链接根路径
        private string m_adminmanagerurl = "";  //管理后台连接根路径
        private int m_closed = 0; //网站关闭
        private string m_ipdenyaccess = ""; //IP禁止访问列表
        private string m_passwordkey = "1234567890"; //用户密码Key
        private int m_onlineusercountcacheminute = 0;//在线用户数统计缓存时间，0为实时统计
        private string m_cookiedomain = "";//身份验证Cookie域
        private string m_verifyimageassemly = "";//验证码生成所使用的程序集
        private int m_onlinetimeout = 10; //多久无动作视为离线
        private int m_deletingexpireduserfrequency = 5;//删除过期用户频率(单位:时间)
        private int m_regctrl = 0; //IP 注册间隔限制(小时)
        private string m_ipregctrl = ""; //特殊 IP 注册限制
        private int m_oltimespan = 20;//用户在线时间更新时长(分钟):
        private string m_nologinpage = "";  //非用户登录页面

        private int m_specialLogin = 0; //开启单点登录
        private int m_userVisitLog = 1; //开启用户搜索访问日志
        private int m_userRouteVisitLog = 1;    //开启用户线路详细访问统计
        #endregion

        #region 属性
        /// <summary>
        /// 版权文字 (只读)
        /// </summary>
        public string Sitecopyright
        {
            get { return "Copyright &copy; 2008-" + DateTime.Now.Year.ToString() + " <a href=\"http://www.sirius.org.cn\" target=\"_blank\">SAS Inc</a>."; }
        }

        /// <summary>
        /// 网站名称
        /// </summary>
        public string Sitetitle
        {
            get { return m_sitetitle; }
            set { m_sitetitle = value; }
        }

        /// <summary>
        /// 网站url地址
        /// </summary>
        public string Siteurl
        {
            get { return m_siteurl; }
            set { m_siteurl = value; }
        }

        /// <summary>
        /// 网站名称
        /// </summary>
        public string Webtitle
        {
            get { return m_webtitle; }
            set { m_webtitle = value; }
        }

        /// <summary>
        /// 网站url地址
        /// </summary>
        public string Weburl
        {
            get { return m_weburl; }
            set { m_weburl = value; }
        }
        /// <summary>
        /// 用户后台链接根路径
        /// </summary>
        public string UserManagerUrl
        {
            get { return m_usermanagerurl; }
            set { m_usermanagerurl = value; }
        }

        /// <summary>
        /// 管理后台链接根路径
        /// </summary>
        public string AdminManagerUrl
        {
            get { return m_adminmanagerurl; }
            set { m_adminmanagerurl = value; }
        }

        /// <summary>
        /// 网站关闭
        /// </summary>
        public int Closed
        {
            get { return m_closed; }
            set { m_closed = value; }
        }

        /// <summary>
        /// IP禁止访问列表
        /// </summary>
        public string Ipdenyaccess
        {
            get { return m_ipdenyaccess; }
            set { m_ipdenyaccess = value; }
        }

        /// <summary>
        /// 用户密码Key
        /// </summary>
        public string Passwordkey
        {
            get { return m_passwordkey; }
            set { m_passwordkey = value; }
        }

        /// <summary>
        /// 在线用户数统计缓存时间，0为实时统计
        /// </summary>
        public int OnlineUserCountCacheMinute
        {
            get { return m_onlineusercountcacheminute; }
            set { m_onlineusercountcacheminute = value; }
        }

        /// <summary>
        /// 身份验证Cookie域
        /// </summary>
        public string CookieDomain
        {
            get { return m_cookiedomain; }
            set { m_cookiedomain = value; }
        }
        /// <summary>
        /// 验证码生成所使用的程序集
        /// </summary>
        public string VerifyImageAssemly
        {
            get { return m_verifyimageassemly; }
            set { m_verifyimageassemly = value; }
        }
        /// <summary>
        /// 多久无动作视为离线
        /// </summary>
        public int Onlinetimeout
        {
            get { return m_onlinetimeout; }
            set { m_onlinetimeout = value; }
        }
        /// <summary>
        /// 删除过期用户频率
        /// </summary>
        public int Deletingexpireduserfrequency
        {
            get
            {
                if (m_deletingexpireduserfrequency < 1)
                    m_deletingexpireduserfrequency = 5;
                return m_deletingexpireduserfrequency;
            }
            set { m_deletingexpireduserfrequency = value; }
        }
        /// <summary>
        /// IP 注册间隔限制(小时)
        /// </summary>
        public int Regctrl
        {
            get { return m_regctrl; }
            set { m_regctrl = value; }
        }
        /// <summary>
        /// 特殊 IP 注册限制
        /// </summary>
        public string Ipregctrl
        {
            get { return m_ipregctrl; }
            set { m_ipregctrl = value; }
        }
        /// <summary>
        /// 用户在线时间更新时长(分钟)
        /// </summary>
        public int Oltimespan
        {
            get { return m_oltimespan; }
            set { m_oltimespan = value; }
        }
        /// <summary>
        /// 非用户登录页面
        /// </summary>
        public string NoLoginPage
        {
            get { return m_nologinpage; }
            set { m_nologinpage = value; }
        }
        /// <summary>
        /// 开启单点登录
        /// </summary>
        public int SpecialLogin
        {
            get { return m_specialLogin; }
            set { m_specialLogin = value; }
        }
        /// <summary>
        /// 开启用户搜索统计
        /// </summary>
        public int UserVisitLog
        {
            get { return m_userVisitLog; }
            set { m_userVisitLog = value; }
        }
        /// <summary>
        /// 开启用户线路详细访问统计
        /// </summary>
        public int UserRouteVisitLog
        {
            get { return m_userRouteVisitLog; }
            set { m_userRouteVisitLog = value; }
        }
        #endregion
    }
}
